<html>
	<head>  
		<meta charset="UTF-8"/>
		<title>立方体工具</title>
		
		<style>
			body{
				background-color: #f0f0f0;
				width: 230px;
				height: 200px;
			}
		</style>
  </head> 
	
	<body>
		<div>
			<div>长度：<input id="cd" type="text" value="1000"></div><br/>
			<div>宽度：<input id="kd" type="text" value="1000"></div><br/>
			<div>高度：<input id="gd" type="text" value="1000"></div><br/>
			<div>材质：
			<select id="cz">
				<option value="red">red</option>
				<option value="yellow">yellow</option>
				<option value="purple">purple</option>
			</select>
			</div>
		</div>
		<div style="float: right; margin-right: 10px;">
			<input type="button" value="确定" onclick="confirm()">
			<input type="button" value="取消" onclick="cancel()">
		</div>
	</body>
	<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
	<script>
		function confirm(){
			var cd = $("#cd").val();
			var kd = $("#kd").val();
			var gd = $("#gd").val();
			var cz = $("#cz option:selected").text()
			var data_arr = [cd, kd, gd, cz]
			sketchup.confirm(data_arr); //数据传输到ruby后台
		}
		function cancel(){
			sketchup.cancel();
		}
	</script>
</html>
